home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / WINDOWS / INPOUT32.ZIP / INPOUT32.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-09-28  |  1.4 KB  |  52 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "Form1"
  4.    ClientHeight    =   1692
  5.    ClientLeft      =   912
  6.    ClientTop       =   1404
  7.    ClientWidth     =   2400
  8.    Height          =   2076
  9.    Left            =   864
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   1692
  12.    ScaleWidth      =   2400
  13.    Top             =   1068
  14.    Width           =   2496
  15.    Begin VB.TextBox Text1 
  16.       Height          =   372
  17.       Left            =   120
  18.       TabIndex        =   1
  19.       Text            =   "Text1"
  20.       Top             =   1080
  21.       Width           =   2052
  22.    End
  23.    Begin VB.CommandButton cmdWriteToPort 
  24.       Caption         =   "Write to Port"
  25.       Height          =   732
  26.       Left            =   240
  27.       TabIndex        =   0
  28.       Top             =   120
  29.       Width           =   1932
  30.    End
  31. Attribute VB_Name = "Form1"
  32. Attribute VB_Creatable = False
  33. Attribute VB_Exposed = False
  34. Option Explicit
  35. Dim Value As Byte
  36. Dim PortAddress As Integer
  37. Private Sub cmdWriteToPort_Click()
  38. 'Write a byte to a port, read it back,
  39. '& display the result.
  40. Out PortAddress, Value
  41. Text1.Text = Inp(PortAddress)
  42. Value = Value + 1
  43. If Value = 255 Then Value = 0
  44. End Sub
  45. Private Sub Form_Load()
  46. 'Test program for inpout32.dll
  47. Value = 0
  48. 'Change this value to match the port to write to:
  49. '(Usual parallel-port addresses are &h378, &h278, &h3BC)
  50. PortAddress = &H278
  51. End Sub
  52.